package com.king.service.impl;

import com.king.dao.RoleRepository;
import com.king.pojo.entity.SysRole;
import com.king.pojo.query.RoleQuery;
import com.king.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

/**
 * @author liukai
 */
@Service
public class RoleServiceImpl implements RoleService {

    @Autowired
    private RoleRepository roleRepository;

    @Override
    public Page<SysRole> listRole(RoleQuery roleQuery, Pageable pageable) {
        return roleRepository.findAll(pageable);
    }

    @Override
    public SysRole insert(SysRole role) {
        return roleRepository.save(role);
    }

    @Override
    public SysRole update(SysRole role) {
        return roleRepository.save(role);
    }

}
